#ifndef _FTEXTLINE_H_
#define _FTEXTLINE_H_

namespace Font
{

	class TextDisplay;

	class TextLine
	{
	
	public:
	
		TextLine(Library* a_Library, Text* a_Text);
		~TextLine();

		void Clear();

		void SetTextDisplay(TextDisplay* a_Display);

		void AddCharacterPosition(const tb::Vec2& a_Position);
		void AddCharacterTexCoord(const tb::Vec2& a_TexCoord);
		void NextCharacterCorner();

		void NextCharacter();
	
	protected:

		struct TextCharacter
		{
			TextDisplay* display;
			tb::Vec2 position[4];
			tb::Vec2 texcoord[4];
			int filled;
		};

		TextCharacter* m_CharacterCurrent;
		std::vector<TextCharacter*> m_Characters;

		TextDisplay* m_DisplayCurrent;

		tb::Vec2 m_CornerUpperLeft;
		tb::Vec2 m_CornerLowerRight;
		tb::Vec2 m_Dimensions;

		Text* m_Text;
		Library* m_Library;
	
	}; // class TextLine

}; // namespace Font
	
#endif